package com.example.rabbitmq.ksdemo.Thread;

import com.example.rabbitmq.ksdemo.callback.CallBack;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ThreadManager implements CallBack {

    public static final ArrayBlockingQueue<Runnable> runnableTasks=new ArrayBlockingQueue<>(1000);

//    public static final ThreadPoolExecutor executor = new ThreadPoolExecutor(
//            60, 100, 200, TimeUnit.MILLISECONDS, runnableTasks);

    public static final ThreadPoolExecutor executor = new ThreadPoolExecutor(
            100, 200, 800, TimeUnit.MILLISECONDS, runnableTasks);

    @Override
    public void ReceiveData(String message) {
        executor.execute(new ReceviceThread(message));
    }
}
